import Mock from 'mockjs'

const data = Mock.mock({
  'items|6': [{
    id: '@id',
    title: '@sentence(10, 20)',
    'status|1': ['0', '1', '2'],
    author: 'name',
    display_time: '@datetime',
    pageviews: '@integer(300, 5000)',
    organizationId: '@integer(0, 10)',
    chargeId: '@integer(0, 10)',
    price: '@integer(0, 10)',
    content: '@sentence(10, 20)'
  }]
})

export default [
  {
    url: '/vue-admin-template/table/list',
    type: 'get',
    response: config => {
      const items = data.items
      return {
        code: 20000,
        data: {
          total: items.length * 13,
          items: items
        }
      }
    }
  },
  {
    url: '/vue-admin-template/table/getListPage',
    type: 'get',
    response: config => {
      const items = data.items
      return {
        code: 20000,
        data: {
          total: items.length * 13,
          items: items
        }
      }
    }
  }
]
